@import '~igniteui-angular/lib/core/styles/themes/index';

// // Import utilities
// @import '~igniteui-angular/lib/core/styles/themes/utilities';

// // Common component modules
// @import '~igniteui-angular/lib/core/styles/themes/components/_common/igx-control';
// @import '~igniteui-angular/lib/core/styles/themes/components/_common/igx-display-container';
// @import '~igniteui-angular/lib/core/styles/themes/components/_common/igx-drag';
// @import '~igniteui-angular/lib/core/styles/themes/components/_common/igx-vhelper';

// // Ensure the ripple is loaded before other component themes
// @import '~igniteui-angular/lib/core/styles/themes/components/ripple/ripple-component';

// // Component composition styles
// @import '~igniteui-angular/lib/core/styles/themes/components/grid/grid-component';
// @import '~igniteui-angular/lib/core/styles/themes/components/grid-summary/grid-summary-component';

// @import '../themes/dark/index';

/// Includes the base for each theme.
// [class^='igx-'] {
//     &,
//     *,
//     *::before,
//     *::after {
//         box-sizing: border-box;
//     }
// }

// /// @param {boolean} $print-layout [true] - Activates the printing styles of the components.
// /// @param {string} $direction [ltr] - Sets the layout direction. Can be 'ltr' or 'rtl'.
// /// @param {color} $foreground-color [0, 0, 0, .87] - Sets the value of the global $igx-foreground-color used in all typography styles.
// /// @requires {mixin} igx-typography
// /// @requires {mixin} igx-vhelper
// /// @requires {mixin} igx-print-layout
// @mixin igx-core(
//     $print-layout: true,
//     $direction: ltr,
// ) {
//     @if $direction != ltr and $direction != rtl {
//         $direction: ltr !global;
//     } @else {
//         $direction: $direction !global;
//     }

//     @include igx-typography();
//     @include igx-vhelper();

//     @if $print-layout == true {
//         @include igx-print-layout();
//     }
// }

// @import '~igniteui-angular/lib/core/styles/themes/components/grid/grid-theme';
// @import '~igniteui-angular/lib/core/styles/themes/components/grid-summary/grid-summary-theme';


/// Generates an Ignite UI for Angular global theme.
/// @param {Map} $palette - An igx-palette to be used by the global theme.
/// @param {Map} $schema [$light-schema] - The schema used as basis for styling the components.
/// @param {List} $exclude [( )] - A list of igx components to be excluded from the global theme styles.
/// @param {Boolean} $legacy-support [false] - If set to true, it turns on support for IE11, i.e. css variables are not used in the generated component themes.
/// @param {Boolean} $elevation [true] - Turns on/off elevations for all components in the theme.
/// @param {Number} $roundness [null] - Sets the global roundness factor (the value can be any decimal fraction between 0 and 1) for all components.
/// @requires {variable} $components
/// @requires {variable} $default-palette
/// @requires {function} is-component
/// @requires {mixin} igx-avatar
/// @requires {mixin} igx-badge
/// @requires {mixin} igx-button
/// @requires {mixin} igx-button-group
/// @requires {mixin} igx-calendar
/// @requires {mixin} igx-card
/// @requires {mixin} igx-carousel
/// @requires {mixin} igx-checkbox
/// @requires {mixin} igx-date-picker
/// @requires {mixin} igx-date-range-picker
/// @requires {mixin} igx-dialog
/// @requires {mixin} igx-drop-down
/// @requires {mixin} igx-expansion-panel
/// @requires {mixin} igx-grid
/// @requires {mixin} igx-grid-summary
/// @requires {mixin} igx-paginator
/// @requires {mixin} igx-icon
/// @requires {mixin} igx-input-group
/// @requires {mixin} igx-list
/// @requires {mixin} igx-navbar
/// @requires {mixin} igx-navdrawer
/// @requires {mixin} igx-progress-linear
/// @requires {mixin} igx-progress-circular
/// @requires {mixin} igx-radio
/// @requires {mixin} igx-ripple
/// @requires {mixin} igx-slider
/// @requires {mixin} igx-snackbar
/// @requires {mixin} igx-switch
/// @requires {mixin} igx-tabs
/// @requires {mixin} igx-bottom-nav
/// @requires {mixin} igx-toast
@mixin igx-theme(
    $palette,
    $schema: $light-schema,
    $exclude: (),
    $legacy-support: false,
    $roundness: null,
    $elevation: true,
) {
    // Stores all excluded component styles
    $excluded: ();

    $default-palette: $palette !global;
    $igx-legacy-support: $legacy-support !global;

    @if length($exclude) > 0 {
        $excluded: is-component($exclude);
    }

    @if length($excluded) > 0 {
        @warn unquote('You have excluded the following components from the theme: "#{$excluded}". You can now add your own themes for the excluded components.');
    }

    @if not(index($exclude, 'igx-ripple')) {
        @include igx-ripple(igx-ripple-theme($palette, $schema));
    }

    @if not(index($exclude, 'igx-button')) {
        @include igx-button(igx-button-theme(
            $palette,
            $schema,
            $flat-border-radius: $roundness,
            $raised-border-radius: $roundness,
            $outlined-border-radius: $roundness,
            $fab-border-radius: $roundness,
            $icon-border-radius: $roundness,
            $raised-resting-shadow: if($elevation == false, none, null),
            $raised-hover-shadow: if($elevation == false, none, null),
            $raised-focus-shadow: if($elevation == false, none, null),
            $fab-resting-shadow: if($elevation == false, none, null),
            $fab-hover-shadow: if($elevation == false, none, null),
            $fab-focus-shadow: if($elevation == false, none, null),
        ));
    }

    @if not(index($exclude, 'igx-button-group')) {
        @include igx-button-group(igx-button-group-theme(
            $palette,
            $schema,
            $border-radius: $roundness,
            $shadow: if($elevation == false, 'none', null),
        ));
    }

    @if not(index($exclude, 'igx-checkbox')) {
        @include igx-checkbox(igx-checkbox-theme(
            $palette,
            $schema,
            $border-radius: $roundness,
            $border-radius-ripple: $roundness,
        ));
    }

    @if not(index($exclude, 'igx-chip')) {
        @include igx-chip(igx-chip-theme(
            $palette,
            $schema,
            $border-radius: $roundness,
            $ghost-shadow: if($elevation == false, none, null),
        ));
    }

    @if not(index($exclude, 'igx-column-hiding')) {
        @include igx-column-hiding(igx-column-hiding-theme($palette, $schema));
    }

    @if not(index($exclude, 'igx-circular-bar')) {
        @include igx-progress-circular(igx-progress-circular-theme($palette, $schema));
    }

    @if not(index($exclude, 'igx-linear-bar')) {
        @include igx-progress-linear(igx-progress-linear-theme($palette, $schema));
    }

    @if not(index($exclude, 'igx-dialog')) {
        @include igx-dialog(igx-dialog-theme(
            $palette,
            $schema,
            $border-radius: $roundness,
            $shadow: if($elevation == false, none, null),
        ));
    }

    @if not(index($exclude, 'igx-divider')) {
        @include igx-divider(igx-divider-theme($palette, $schema));
    }

    @if not(index($exclude, 'igx-drop-down')) {
        @include igx-drop-down(igx-drop-down-theme(
            $palette,
            $schema,
            $border-radius: $roundness,
            $shadow: if($elevation == false, none, null),
        ));
    }

    @if not(index($exclude, 'igx-input-group')) {
        @include igx-input-group(igx-input-group-theme(
            $palette,
            $schema,
            $box-border-radius: $roundness,
            $border-border-radius: $roundness,
            $search-border-radius: $roundness,
            $search-resting-shadow: if($elevation == false, none, null),
            $search-hover-shadow: if($elevation == false, none, null),
            $search-disabled-shadow: if($elevation == false, none, null),
        ));
    }

    @if not(index($exclude, 'igx-list')) {
        @include igx-list(igx-list-theme(
            $palette,
            $schema,
            $border-radius: $roundness,
            $item-border-radius: $roundness,
        ));
    }

    @if not(index($exclude, 'igx-grid')) {
        @include igx-grid(igx-grid-theme(
            $palette,
            $schema,
            $drop-area-border-radius: $roundness,
            $grid-shadow: if($elevation == false, none, null),
            $drag-shadow: if($elevation == false, none, null),
        ));
    }

    @if not(index($exclude, 'igx-grid-summary')) {
        @include igx-grid-summary(igx-grid-summary-theme($palette, $schema));
    }

    @if not(index($exclude, 'igx-grid-toolbar')) {
        @include igx-grid-toolbar(igx-grid-toolbar-theme($palette, $schema));
    }

    @if not(index($exclude, 'igx-overlay')) {
        @include igx-overlay(igx-overlay-theme($palette, $schema));
    }

    @if not(index($exclude, 'igx-paginator')) {
        @include igx-paginator(igx-paginator-theme($palette, $schema));
    }

    @if not(index($exclude, 'igx-scrollbar')) {
        @include igx-scrollbar(igx-scrollbar-theme($palette, $schema));
    }

}

// /// Creates a global theme that can be used with light backgrounds.
// /// @param {Map} $palette - An igx-palette to be used by the global theme.
// /// @param {List} $exclude [( )] - A list of igx components to be excluded from the global theme styles.
// /// @param {Boolean} $legacy-support [false] - If set to true, it turns on support for IE11, i.e. css variables are not used in the generated component themes.
// @mixin igx-light-theme(
//     $palette,
//     $exclude: (),
//     $legacy-support: false,
//     $roundness: null,
//     $elevation: true,
// ) {
//     $grays: igx-color($palette, 'grays');
//     $surface: igx-color($palette, 'surface');

//     $light-palette: igx-palette(
//         $primary: igx-color($palette, 'primary'),
//         $secondary: igx-color($palette, 'secondary'),
//         $info: igx-color($palette, 'info'),
//         $success: igx-color($palette, 'success'),
//         $warn: igx-color($palette, 'warn'),
//         $error: igx-color($palette, 'error'),
//         $surface: if($surface != #fff, $surface, #fff),
//         $grays: if($grays != rgba(0, 0, 0, .38), $grays, #000),
//     );

//     @include igx-theme(
//         $palette: $light-palette,
//         $schema: $light-schema,
//         $legacy-support: $legacy-support,
//         $exclude: $exclude,
//         $roundness: $roundness,
//         $elevation: $elevation,
//     );
// }

/// Creates a global theme that can be used with dark backgrounds.
/// @param {Map} $palette - An igx-palette to be used by the global theme.
/// @param {List} $exclude [( )] - A list of igx components to be excluded from the global theme styles.
/// @param {Boolean} $legacy-support [false] - If set to true, it turns on support for IE11, i.e. css variables are not used in the generated component themes.
@mixin igx-cosmic-theme(
    $palette,
    $exclude: (),
    $legacy-support: false,
    $roundness: null,
    $elevation: true,
) {
    $grays: igx-color($palette, 'grays');
    $surface: igx-color($palette, 'surface');

    $dark-palette: igx-palette(
        $primary: igx-color($palette, 'primary'),
        $secondary: igx-color($palette, 'secondary'),
        $info: igx-color($palette, 'info'),
        $success: igx-color($palette, 'success'),
        $warn: igx-color($palette, 'warn'),
        $error: igx-color($palette, 'error'),
        $surface: if($surface != #fff, $surface, #222),
        $grays: if($grays != rgba(0, 0, 0, .38), $grays, #fff),
    );

    @include igx-theme(
        $palette: $dark-palette,
        $schema: $cosmic-schema,
        $legacy-support: $legacy-support,
        $exclude: $exclude,
        $roundness: $roundness,
        $elevation: $elevation,
    );
}

// /// Creates a global fluent theme that can be used with light backgrounds.
// /// @param {Map} $palette - An igx-palette to be used by the global theme.
// /// @param {List} $exclude [( )] - A list of igx components to be excluded from the global theme styles.
// /// @param {Boolean} $legacy-support [false] - If set to true, it turns on support for IE11, i.e. css variables are not used in the generated component themes.
// @mixin igx-fluent-theme(
//     $palette,
//     $exclude: (),
//     $legacy-support: false,
//     $roundness: null,
//     $elevation: true,
// ) {
//     $primary: igx-color($palette, 'primary');
//     $secondary: igx-color($palette, 'secondary');
//     $surface: igx-color($palette, 'surface');

//     @include igx-typography(
//         $font-family: "'Open Sans', Helvetica, Arial, sans-serif",
//         $type-scale: $fluent-type-scale,
//     );

//     @include igx-theme(
//         $palette: igx-palette(
//             $primary,
//             $secondary,
//             $surface: if($surface != #fff, $surface, #fff),
//             $grays: #000
//         ),
//         $schema: $light-fluent-schema,
//         $legacy-support: $legacy-support,
//         $exclude: $exclude,
//         $roundness: $roundness,
//         $elevation: $elevation,
//     );
// }

// /// Creates a global fluent theme that can be used with dark backgrounds.
// /// @param {Map} $palette - An igx-palette to be used by the global theme.
// /// @param {List} $exclude [( )] - A list of igx components to be excluded from the global theme styles.
// /// @param {Boolean} $legacy-support [false] - If set to true, it turns on support for IE11, i.e. css variables are not used in the generated component themes.
// @mixin igx-fluent-dark-theme(
//     $palette,
//     $exclude: (),
//     $legacy-support: false,
//     $roundness: null,
//     $elevation: true,
// ) {
//     $primary: igx-color($palette, 'primary');
//     $secondary: igx-color($palette, 'secondary');
//     $surface: igx-color($palette, 'surface');

//     @include igx-typography(
//         $font-family: "'Open Sans', Helvetica, Arial, sans-serif",
//         $type-scale: $fluent-type-scale
//     );

//     @include igx-theme(
//         $palette: igx-palette(
//             $primary,
//             $secondary,
//             $surface: if($surface != #fff, $surface, #222),
//             $grays: #fff
//         ),
//         $schema: $dark-fluent-schema,
//         $legacy-support: $legacy-support,
//         $exclude: $exclude,
//         $roundness: $roundness,
//         $elevation: $elevation,
//     );
// }


// /// Creates a global bootstrap-like theme that can be used with light backgrounds.
// /// @param {Map} $palette - An igx-palette to be used by the global theme.
// /// @param {List} $exclude [( )] - A list of igx components to be excluded from the global theme styles.
// /// @param {Boolean} $legacy-support [false] - If set to true, it turns on support for IE11, i.e. css variables are not used in the generated component themes.
// @mixin igx-bootstrap-theme(
//     $palette,
//     $exclude: (),
//     $legacy-support: false,
//     $roundness: null,
//     $elevation: true,
// ) {
//     $primary: igx-color($palette, 'primary');
//     $secondary: igx-color($palette, 'secondary');
//     $surface: igx-color($palette, 'surface');

//     @include igx-typography(
//         $font-family: '-apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',
//         $type-scale: $bootstrap-type-scale
//     );

//     @include igx-calendar-typography($bootstrap-type-scale, $categories: (
//         weekday-labels: 'calendar-labels',
//         card-title: 'card-title',
//     ));

//     @include igx-card-typography($bootstrap-type-scale, $categories: (
//         title: 'h5',
//         subtitle: 'body-1',
//         content: 'body-1'
//     ));

//     @include igx-dialog-typography($bootstrap-type-scale, $categories: (
//         title: 'h5',
//     ));

//     @include igx-drop-down-typography($bootstrap-type-scale, $categories: (
//         header: 'subtitle-1',
//         item: 'subtitle-1',
//         select-item: 'subtitle-1'
//     ));

//     @include igx-list-typography($bootstrap-type-scale, $categories: (
//         item: 'body-2',
//         title: 'body-1',
//         subtitle: 'subtitle-1'
//     ));

//     @include igx-theme(
//         $palette: igx-palette(
//             $primary,
//             $secondary,
//             $surface: if($surface != #f8f9fa, $surface, #f8f9fa),
//             $grays: #212529
//         ),
//         $schema: $light-bootstrap-schema,
//         $legacy-support: $legacy-support,
//         $exclude: $exclude,
//         $roundness: $roundness,
//         $elevation: $elevation,
//     );
// }

// /// Creates a global bootstrap-like theme that can be used with dark backgrounds.
// /// @param {Map} $palette - An igx-palette to be used by the global theme.
// /// @param {List} $exclude [( )] - A list of igx components to be excluded from the global theme styles.
// /// @param {Boolean} $legacy-support [false] - If set to true, it turns on support for IE11, i.e. css variables are not used in the generated component themes.
// @mixin igx-bootstrap-dark-theme(
//     $palette,
//     $exclude: (),
//     $legacy-support: false,
//     $roundness: null,
//     $elevation: true,
// ) {
//     $primary: igx-color($palette, 'primary');
//     $secondary: igx-color($palette, 'secondary');
//     $surface: igx-color($palette, 'surface');

//     @include igx-typography(
//         $font-family: '-apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',
//         $type-scale: $bootstrap-type-scale
//     );

//     @include igx-calendar-typography($bootstrap-type-scale, $categories: (
//         weekday-labels: 'calendar-labels',
//         card-title: 'card-title',
//     ));

//     @include igx-card-typography($bootstrap-type-scale, $categories: (
//         title: 'h5',
//         subtitle: 'body-1',
//         content: 'body-1'
//     ));

//     @include igx-dialog-typography($bootstrap-type-scale, $categories: (
//         title: 'h5',
//     ));

//     @include igx-drop-down-typography($bootstrap-type-scale, $categories: (
//         header: 'subtitle-1',
//         item: 'subtitle-1',
//         select-item: 'subtitle-1'
//     ));

//     @include igx-theme(
//         $palette: igx-palette(
//             $primary,
//             $secondary,
//             $surface: if($surface != #f8f9fa, $surface, #222),
//             $grays: #fff
//         ),
//         $schema: $dark-bootstrap-schema,
//         $legacy-support: $legacy-support,
//         $exclude: $exclude,
//         $roundness: $roundness,
//         $elevation: $elevation,
//     );
// }
